package com.mhsoft.fenak.utils;

import android.content.Context;
import android.widget.Toast;

public class TextValidation {

	public static boolean validateSignIn(Context context, String email, String pass) {
		if(email.length()<1 || pass.length()<1){
			Toast.makeText(context, "Complete data first", Toast.LENGTH_LONG).show();
			return false;
		}
		else return true;
	}

	public static boolean validateRegisteration(Context context, String fname, String lname, String email, String username, String pass, String confPass, String mobile) {
		if(fname.length()<1 || lname.length()<1 || email.length()<1 || pass.length()<1 || confPass.length()<1 || username.length()<1 || mobile.length()<1){
			Toast.makeText(context, "Complete data first", Toast.LENGTH_LONG).show();
			return false;
		}else if(pass.length()<6){
			Toast.makeText(context, "Password must be at least 6 characters", Toast.LENGTH_LONG).show();
			return false;
		}else if(!pass.equals(confPass)){
			Toast.makeText(context, "Password Confirm-Password must be the same", Toast.LENGTH_LONG).show();
			return false;
		}
		else return true;
	}

}
